package com.dlc.shop.sms4j.listener;

import com.dlc.shop.bean.event.sms4j.CreateSmsBeadEvent;
import com.dlc.shop.sms4j.config.ReadConfig;
import lombok.AllArgsConstructor;
import org.dromara.sms4j.core.factory.SmsFactory;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @author gaozijie
 * @date 2023-08-09
 */
@Component
@AllArgsConstructor
public class CreateSmsBeadListener {
    private final ReadConfig config;

    @EventListener(CreateSmsBeadEvent.class)
    public void createSmsBlend() {
        // 创建SmsBlend 短信实例
        SmsFactory.createSmsBlend(config);
    }



}
